package com.zixun.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.zixun.R;
import com.zixun.activity.AboutActivity;
import com.zixun.activity.DiaryActivity;
import com.zixun.activity.SettingActivity;




public class WeFragment extends Fragment {

    private TextView center_text;
    private RelativeLayout about;
    private RelativeLayout view_setting;
    private RelativeLayout diary_layout;
    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.we_fragment, container, false );
        center_text = (TextView) view.findViewById(R.id.center_text);
        center_text.setText("我的");
        about =(RelativeLayout)view.findViewById(R.id.about);
        about.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), AboutActivity.class);
                startActivity(intent);
            }
        });
        view_setting = (RelativeLayout)view.findViewById(R.id.view_setting);
        view_setting.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), SettingActivity.class);
                startActivity(intent);
            }
        });
        diary_layout = (RelativeLayout)view.findViewById(R.id.diary_layout);
        diary_layout.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(getActivity(), DiaryActivity.class);
                startActivity(intent);
            }
        });
        return view;
    }
}
